<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Profile</title>
<script src="references/js/jquery-2.1.0.min.js"></script>
<script>
	$(function() {
		$("#email").attr("pattern", "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$");
		$("#email").attr("required", "");
		$("#bankAccountNo").attr("pattern", "[0-9]*");
		$("#name").attr("required", "");
	});
</script>
</head>
<body>
	<tiles:insertTemplate template="/pages/masterpage/masterPage.jsp">

		<tiles:putAttribute name="body">
			<logic:empty name="username" scope="session">
				<logic:forward name="home" />
			</logic:empty>
			
			
	<div class="col-lg-6 col-lg-offset-3">
	<div class="panel-group" id="accordion">
  <div class="panel panel-info">
    <div class="panel-heading">
      <h4 class="panel-title">
       View Profile
		
	  <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
         <i class="fa fa-angle-double-down" style="float:right"></i>
        </a>
		
      </h4>
	 
    </div>
    <div id="collapseTwo" class="panel-collapse collapse in">
      <div class="panel-body">
		
		<p style="text-align: center">${username}</p>

				<html:form action="/updateProfile"> 
			 <html:text property="email" value="${userInfo.email }" styleClass="form-control"
						styleId="email"></html:text>
					<br>
		 <html:text property="name" value="${userInfo.name }" styleClass="form-control"
						styleId="name"></html:text>
					<br>
				<p style="text-align: center">		<html:submit styleClass="btn btn-primary">Update</html:submit></p>
				</html:form>
      </div>
    </div>
  </div>
	</div>
 
	</div>
	
				<html:link action="/goHome">Home</html:link>
		</tiles:putAttribute>
	</tiles:insertTemplate>
</body>
</html>